/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

/* 加载屏幕 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2c3e50, #4ca1af);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: pulse 1.5s infinite ease-in-out;
}

.loading-text {
    font-size: 1.5rem;
    color: white;
    letter-spacing: 3px;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #2c3e50, #4ca1af);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 500px;
    background: linear-gradient(to bottom, #333, #111);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 8px solid #b49231;
}

/* 金币显示区域 */
.coin-display {
    width: 100%;
    padding: 10px 20px;
    background: linear-gradient(to right, #5e4200, #b49231, #5e4200);
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.4);
}

.coin-amount {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: #ffffff;
    text-shadow: 0 0 10px #ffbf00, 0 0 20px #ffbf00;
}

.coin-icon {
    margin-right: 10px;
    font-size: 2.5rem;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 老虎机样式 */
.slot-machine {
    width: 100%;
    position: relative;
}

.win-message {
    position: absolute;
    top: -40px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 1.8rem;
    color: #ffbf00;
    text-shadow: 0 0 10px #ff7b00;
    opacity: 0;
    z-index: 10;
    transition: all 0.3s ease;
}

.win-message.active {
    opacity: 1;
    transform: translateY(10px);
}

.reels-container {
    display: flex;
    justify-content: space-between;
    background: #000;
    border-radius: 15px;
    padding: 15px;
    border: 5px solid #b49231;
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.5);
    overflow: hidden;
    position: relative;
}

.reels-container::before {
    content: '';
    position: absolute;
    top: 33.33%;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 5;
}

.reels-container::after {
    content: '';
    position: absolute;
    top: 66.66%;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 5;
}

.reel {
    flex: 1;
    height: 300px;
    margin: 0 5px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #1a1a1a;
}

.symbols-container {
    position: absolute;
    width: 100%;
    top: 0;
    transition: top 0.1s linear;
}

.symbol {
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    background-color: #1a1a1a;
    border-radius: 5px;
    transition: transform 0.2s ease;
}

.symbol.highlight {
    transform: scale(1.1);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 5px #fff;
}

/* 控制区域样式 */
.controls {
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.bet-controls {
    display: flex;
    align-items: center;
}

.bet-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #f5a623, #f27121);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.bet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.bet-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.bet-amount {
    width: 80px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    margin: 0 10px;
    text-shadow: 0 0 10px #ffbf00;
}

.spin-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ff4e50, #f9d423);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.spin-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.5);
}

.spin-btn:active {
    transform: translateY(2px) scale(0.95);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

.spin-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(45deg);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { transform: rotate(45deg) translateX(-100%); }
    100% { transform: rotate(45deg) translateX(100%); }
}

.max-bet-btn {
    padding: 10px 15px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #8E2DE2, #4A00E0);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.max-bet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.max-bet-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* 弹出消息样式 */
.popup-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: #222;
    color: #ffbf00;
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    z-index: 100;
    opacity: 0;
    transition: all 0.2s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7),
                inset 0 0 15px rgba(255, 215, 0, 0.3),
                inset 0 0 5px rgba(255, 215, 0, 0.5);
    border: 2px solid #b49231;
    overflow: hidden;
    visibility: hidden;
    max-width: 90%;
    width: auto;
}

.popup-message.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    animation: fadeInOut 1.5s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
}

/* 飞行金币样式 */
.flying-coin {
    position: fixed;
    font-size: 1.5rem;
    z-index: 50;
    pointer-events: none;
    animation: fly 1.5s ease-out forwards;
}

@keyframes fly {
    0% {
        transform: scale(0.5) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 0;
    }
}

/* 胜利高亮效果 */
.highlight {
    animation: highlight 1s ease-in-out;
}

@keyframes highlight {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 20px #ffbf00, 0 0 40px #ffbf00; }
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        width: 95%;
        padding: 15px;
    }
    
    .reel {
        height: 250px;
    }
    
    .symbol {
        height: 83.33px;
        font-size: 3rem;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .spin-btn {
        order: 1;
        width: 80px;
        height: 80px;
        font-size: 1.2rem;
        margin: 0 auto;
    }
    
    .bet-controls {
        order: 2;
        width: 100%;
        justify-content: center;
    }
    
    .max-bet-btn {
        order: 3;
        width: 100%;
        padding: 12px;
    }
    
    .bet-btn {
        width: 40px;
        height: 40px;
    }
    
    .bet-amount {
        width: 80px;
        font-size: 1.2rem;
    }
    
    .symbol-payouts {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .help-btn {
        bottom: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* 特效：闪光效果 */
.slot-machine::after {
    content: '';
    position: absolute;
    top: -10%;
    left: -100%;
    width: 50%;
    height: 150%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: skewX(-20deg);
}

.slot-machine.shine::after {
    animation: shine-effect 1.5s ease-in-out;
}

@keyframes shine-effect {
    0% { left: -100%; }
    100% { left: 150%; }
}

/* 特效：中奖时的震动效果 */
.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* 帮助按钮 */
/* 菜单样式 */
.menu-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 50;
}

.menu-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    border: none;
    background: linear-gradient(135deg, #3a1c71, #d76d77, #ffaf7b);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 51;
    display: flex;
    justify-content: center;
    align-items: center;
    outline: none; /* 移除点击时的轮廓 */
}

.menu-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.menu-btn.active {
    transform: rotate(90deg);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.menu-dropdown {
    position: absolute;
    bottom: 70px;
    right: 10px;
    background: linear-gradient(to bottom, #2c3e50, #1a1a1a);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    width: 180px;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.2s ease;
    z-index: 50;
}

.menu-dropdown.active {
    transform: scale(1);
    opacity: 1;
}

.menu-item {
    padding: 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
}

.menu-icon {
    margin-right: 12px;
    font-size: 1.5rem;
}

.menu-text {
    font-size: 1rem;
    font-weight: 500;
}

/* 对话框通用样式 */
.help-modal, .stats-modal, .paylines-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.help-modal.active, .stats-modal.active, .paylines-modal.active {
    opacity: 1;
    visibility: visible;
}

.help-content, .stats-content, .paylines-content {
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: linear-gradient(to bottom, #2c3e50, #1a1a2e);
    border-radius: 15px;
    padding: 30px;
    position: relative;
    border: 4px solid #b49231;
    box-shadow: 0 0 30px rgba(255, 191, 0, 0.3);
    overflow-y: auto;
    transform: translateY(30px);
    transition: all 0.4s ease;
}

.help-modal.active .help-content, 
.stats-modal.active .stats-content,
.paylines-modal.active .paylines-content {
    transform: translateY(0);
}

.help-content h2, .stats-content h2, .paylines-content h2 {
    color: #ffbf00;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 191, 0, 0.5);
}

.help-close, .stats-close, .paylines-close {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #ffbf00;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.help-close:hover, .stats-close:hover, .paylines-close:hover {
    transform: scale(1.2) rotate(90deg);
}

.help-info, .stats-info, .paylines-info {
    color: #fff;
}

.help-info h3, .stats-info h3, .paylines-info h3 {
    color: #ffbf00;
    margin: 15px 0 10px;
}

.help-info p, .help-info li, .stats-info p, .paylines-info p {
    margin-bottom: 8px;
    line-height: 1.4;
}

/* 符号支付表 */
.symbol-payouts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.payout-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.payout-item span {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

/* 统计信息样式 */
.stats-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.stats-label {
    font-weight: bold;
    color: #ffbf00;
}

.stats-value {
    font-family: monospace;
    font-size: 1.2rem;
}

/* 支付线样式 */
.payline-item {
    margin-bottom: 20px;
}

.payline-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 5px;
}

.payline-grid .cell {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.payline-grid .cell.active {
    background-color: rgba(255, 215, 0, 0.2);
}

.payline-grid .cell.active::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.5), transparent);
}

.payline-name {
    text-align: center;
    font-size: 1rem;
    color: #ffbf00;
}
